package cn.circle.system.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.validator.constraints.NotEmpty;

/**
 * 功能：用户实体类 
 * 对应数据库表：SYS_USER 
 * 作者：
 * 时间：
 */

@Entity
@Table(name = "SYS_USER")
@DynamicInsert(true)
@DynamicUpdate(true)
public class SysUser {
	
	private Integer userId; // 客户id，唯一，自增长，主键
	private String nickName;//用户昵称
	private String userName; // 用户名称，不唯一
	private String passWord; //登入密码
	
	//private String school;//注册学校
	private Byte status;//状态：9为正常，0为禁用,1为注销
	private String phone;
	private String address; // 用户送货地址
	
	
	@Id
	@Column(name = "USER_ID", unique = true, nullable = false)
	@GeneratedValue(strategy = GenerationType.AUTO) // 自增长
	public Integer getUserId() {
		return userId;
	}
	
	public void setUserId(Integer userId) {
		this.userId = userId;
	}
	
	@Column(name = "NICK_NAME")
	public String getNickName() {
		return nickName;
	}

	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	
	
	@Column(name = "USER_NAME")
	public String getUserName() {
		return userName;
	}
	public void setUserName(String userName) {
		this.userName = userName;
	}
	@NotEmpty
	@Column(name = "PASSWORD",nullable = false)
	public String getPassWord() {
		return passWord;
	}
	public void setPassWord(String passWord) {
		this.passWord = passWord;
	}
/*	@NotEmpty
	@Column(name="SCHOOL",nullable =false)
	public String getSchool() {
		return school;
	}
	public void setSchool(String school) {
		this.school = school;
	}*/
	@Column(name = "STATUS", nullable = false, columnDefinition = "tinyint default 9")	
	public Byte getStatus() {
		return status;
	}
	public void setStatus(Byte status) {
		this.status = status;
	}

	@Column(name = "PHONE" , nullable = false)
	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "ADDRESS")
	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	
	
	
	
}
